import { createRouter, createWebHistory } from "vue-router";
import homeIcon from "@/assets/image/home-icon.png";
import accountIcon from "@/assets/image/account-icon.png";
import backStageIcon from "@/assets/image/back-stage-icon.png";
import login from "@/views/login/login.vue";
import home from "@/views/home/index.vue";
import test from "@/views/test.vue"

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: '/test',
      name: 'test',
      component: test,
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    
    {
      path: "/home",
      name: "home",
      component: home,
      meta: {
        title: "首頁",
        menuIndex: "0",
        icon: homeIcon,
      },
    },
    {
      path: "/account",
      name: "account",
      component: () => import("@/views/account/index.vue"),
      meta: {
        title: "賬戶",
        menuIndex: "1",
        icon: accountIcon,
      },
      children: [
        {
          path: "daily",
          name: "daily",
          component: () => import("@/views/account/daily.vue"),
          meta: {
            title: "每日",
            menuIndex: "1-1",
          },
        },
        {
          path: "detail",
          name: "detail",
          component: () => import("@/views/account/detail.vue"),
          meta: {
            title: "詳情",
            menuIndex: "1-2",
          },
        },
        {
          path: "sum",
          name: "sum",
          component: () => import("@/views/account/sum.vue"),
          meta: {
            title: "滙縂",
            menuIndex: "1-3",
          },
        },
        {
          path: "recharge",
          name: "recharge",
          component: () => import("@/views/account/recharge.vue"),
          meta: {
            title: "充值",
            menuIndex: "1-4",
          },
        },
        {
          path: "result",
          name: "result",
          component: () => import("@/views/account/result.vue"),
          meta: {
            title: "充值",
            menuIndex: "",
          },
        },
        {
          path: "withdraw",
          name: "withdraw",
          component: () => import("@/views/account/withdraw.vue"),
          meta: {
            title: "提現",
            menuIndex: "1-5",
          },
        },
        // {
        //   path: "agentPay",
        //   name: "agentPay",
        //   component: () => import("@/views/account/agentPay.vue"),
        //   meta: {
        //     title: "代付",
        //     menuIndex: "1-6",
        //   },
        // },
      ],
    },
    {
      path: "/backStage",
      name: "backStage",
      component: () => import("@/views/backStage/index.vue"),
      meta: {
        title: "後台",
        menuIndex: "2",
        icon: backStageIcon,
      },
      children: [
        {
          path: "busiInfo",
          name: "busiInfo",
          component: () => import("@/views/backStage/busiInfo.vue"),
          meta: {
            title: "商戶信息",
            menuIndex: "2-1",
          },
        },
        // {
        //   path: "originInfo",
        //   name: "originInfo",
        //   component: () => import("@/views/backStage/originInfo.vue"),
        //   meta: {
        //     title: "渠道信息",
        //     menuIndex: "2-2",
        //   },
        // }
      ]
    },
  ],
});
export default router;
